package com.hsqn.service.impl;

import com.hsqn.entity.WorkOrder;
import com.hsqn.entity.WorkOrderLog;
import com.hsqn.mapper.WorkOrderLogMapper;
import com.hsqn.mapper.WorkOrderMapper;
import com.hsqn.service.WorkOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

@Service
public class WorkOrderServiceImpl implements WorkOrderService {
    @Autowired
    private WorkOrderMapper workOrderMapper;

    @Override
    public void insertWorkOrder(WorkOrder workOrder) {
        workOrder.setCreateTime(LocalDateTime.now());
        workOrder.setUpdateTime(LocalDateTime.now());
        workOrderMapper.insertWorkOrder(workOrder);
    }

    @Override
    public void updateAssignInfo(WorkOrder workOrder) {
        workOrder.setUpdateTime(LocalDateTime.now());
        workOrderMapper.updateAssignInfo(workOrder);
    }

    @Override
    public void updateCompleteInfo(Integer orderStatus) {
        workOrderMapper.updateCompleteInfo(orderStatus);
    }


}
